package com.huluobo.a2308douyindemo.adapter

import android.graphics.Paint
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.huluobo.a2308douyindemo.R
import com.huluobo.a2308douyindemo.bean.HomeGoodsInfo
import com.huluobo.a2308douyindemo.utils.ImageUtils

/**
 *  Created by LC on 2025/11/6.
 */
class HomeChildAdapter : BaseQuickAdapter<HomeGoodsInfo, BaseViewHolder>(R.layout.item_home_child) {
    override fun convert(holder: BaseViewHolder, item: HomeGoodsInfo) {
        ImageUtils.loadRoundImage(context, item.mainImgUrl, holder.getView(R.id.item_home_child_iv), 30)
        holder.setText(R.id.item_home_child_name_tv, item.title)
        holder.setText(R.id.item_home_child_market_price_tv, "￥${item.marketPriceFee}元")
        holder.setText(R.id.item_home_child_purchase_price_tv, "￥${item.purchasePrice}元")
        holder.getView<TextView>(R.id.item_home_child_market_price_tv).paint.flags = Paint.STRIKE_THRU_TEXT_FLAG
    }
}